package com.woniu.his.bms.service;

import com.alipay.api.AlipayApiException;
import com.woniu.his.bms.infra.model.BillsRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.woniu.his.bms.service.dto.BillRecordDto;
import com.woniu.his.bms.service.dto.BmsDoctorPatientFeeDto;

import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 账单记录 服务类
 * </p>
 *
 * @author chenbo
 * @since 2022-11-29
 */
public interface BillsRecordService extends IService<BillsRecord> {

    /**
     * 创建账单
     * @param billType
     * @return
     */
    BillRecordDto createBillRecord(String billType, BigDecimal amount);

    /**
     * 创建账单
     * @param billType
     * @param caseHistoryId
     * @return
     */
    BillRecordDto createBillRecord(String billType,BigDecimal amount,Long caseHistoryId);

    /**
     * 通过病历id查询所有未支付账单
     * @param caseHistoryId
     * @return
     */
    List<BillRecordDto> queryBillRecord(Long caseHistoryId);

    /**
     * 支付接口
     * @param billId
     * @return
     * @throws AlipayApiException
     * @throws UnsupportedEncodingException
     */
    String pay(Long billId) throws AlipayApiException, UnsupportedEncodingException;

    void paySuccess(String billNo);
    List<BmsDoctorPatientFeeDto> listFeeByCaseHistoryId(Long caseHistoryId);
}
